# enums.py
from enum import Enum

class ModuleEnum(str, Enum):
    BOOK = "book"        # 书籍、章节、标签等
    USER = "user"        # 用户个人资源：评论、书架、阅读进度
    ADMIN = "admin"      # 系统管理：用户封禁、内容审核
    SYSTEM = "system"    # 系统级：日志、配置（可选）
    PAYMENT = "payment"  # 未来扩展：付费章节、会员

class ResourceTypeEnum(str, Enum):
    # BOOK 模块
    BOOK = "book"
    CHAPTER = "chapter"
    CATEGORY = "category"
    TAG = "tag"
    
    # USER 模块
    COMMENT = "comment"
    SHELF = "shelf"
    READING_PROGRESS = "reading_progress"
    
    # ADMIN 模块
    USER = "user"        # 管理其他用户
    OPERATION_LOG = "operation_log"
    
    # 未来扩展
    ORDER = "order"      # 支付订单
    WITHDRAWAL = "withdrawal"  # 作者提现

class ActionEnum(str, Enum):
    # 标准 CRUD
    READ = "read"
    CREATE = "create"
    UPDATE = "update"
    DELETE = "delete"
    
    # 业务扩展动作
    PUBLISH = "publish"      # 发布书籍/章节
    AUDIT = "audit"          # 审核内容（通过/拒绝）
    BAN = "ban"              # 封禁用户/评论
    RESTORE = "restore"      # 恢复被删内容
    COLLECT = "collect"      # 收藏（可归入 CREATE，但语义更清）
    LIKE = "like"            # 点赞（高频，可单独控制）
    IMPERSONATE = "impersonate"  # 模拟登录（管理员）
    
    # 支付相关（未来）
    REFUND = "refund"
    WITHDRAW = "withdraw"

class ScopeEnum(str, Enum):
    OWN = "own"        # 仅自己的数据（如：只能删自己的评论）
    ALL = "all"        # 全局数据（如：管理员删任意用户）
    TEAM = "team"       # 团队内数据（如：编辑组可管理本组书籍）→ **可选，初期可不用**